﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Tools.Ribbon;
using Office = Microsoft.Office.Core;


namespace eRechnung_3_0
{
    public partial class ebI_Ribbon : OfficeRibbon
    {
        public ebI_Ribbon()
        {
            InitializeComponent();
        }

        private void ebI_Ribbon_Load(object sender, RibbonUIEventArgs e)
        {

        }
        private void BtnDetails_Click(object sender, RibbonControlEventArgs e)
        {
            Form Details = new FrmDetails();
            Details.Show();

        }

        private void BtnSkonto_Click(object sender, RibbonControlEventArgs e)
        {
            Form myForm = new FrmSkonto();
            myForm.Show();
        }

        private void BtnSave_Click(object sender, RibbonControlEventArgs e)
        {
            eRechnung_3_0.Globals.ThisDocument.SaveXML(false);
        }

        private void BtnEditSettings_Click(object sender, RibbonControlEventArgs e)
        {
            FrmEbInterfaceSettings ebIsetting = new FrmEbInterfaceSettings();
            ebIsetting.Show();
        }

        private void BtnSaveAsTemplate_Click(object sender, RibbonControlEventArgs e)
        {
            eRechnung_3_0.Globals.ThisDocument.SaveXML(true);
        }

        private void BtnLoadTemplate_Click(object sender, RibbonControlEventArgs e)
        {
            eRechnung_3_0.Globals.ThisDocument.LoadTemplateXML();
        }

        private void BtnEbInterface_Click(object sender, RibbonControlEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.ebinterface.at");
        }

        private void BtnAustriaPro_Click(object sender, RibbonControlEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.austriapro.at");
        }

        private void BtnSignatur_Click(object sender, RibbonControlEventArgs e)
        {
            // http://portal.wko.at/wk/format_detail.wk?AngID=1&StID=424389&DstID=940
            System.Diagnostics.Process.Start("http://portal.wko.at/wk/format_detail.wk?AngID=1&StID=424389&DstID=940");
        }

        private void BtnAbout_Click(object sender, RibbonControlEventArgs e)
        {
            Form AboutForm = new AboutForm();
            DialogResult dr = AboutForm.ShowDialog();
        }

        private void BtnHelp_Click(object sender, RibbonControlEventArgs e)
        {
            MessageBox.Show("Weitere Hilfe finden Sie im mitgelieferten Dokument 'Ausfüllhilfe.docx'.");
        }
    }
}
